local sk__dihui = fk.CreateSkill {

  name = "sk__dihui",

  tags = {},

}



sk__dihui:addEffect("active", {
  name = "sk__dihui",
  anim_type = "offensive",
  target_num = 2,
  card_num = 0,
  prompt = function(self, player, selected_cards, selected_targets)
    if #selected_targets == 0 then
      return "#sk__dihui0"
    elseif #selected_targets == 1 then
      return "#sk__dihui1:" .. selected_targets[1].id
    elseif #selected_targets == 2 then
      return "#sk__dihui2:" .. selected_targets[1].id .. ":" .. selected_targets[2].id
    end
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(sk__dihui.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, selected_cards)
    if #selected == 0 then
      return true
    elseif #selected == 1 then
      return selected[1].hp > to_select.hp
    end
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target1 = effect.tos[1]
    local target2 = effect.tos[2]
    room:damage({
      from = target1,
      to = target2,
      damage = 1,
      skillName = sk__dihui.name,
    })
    if target1 ~= player and player:isWounded() and not player.dead then
      room:recover({
        who = player,
        num = 1,
        recoverBy = player,
        skillName = sk__dihui.name,
      })
    end
  end,
})

return sk__dihui
